<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>Search</title>
    <!-- Custom fonts for this template-->
    <link th:href="@{/vendor/fontawesome-free/css/all.min.css}" rel="stylesheet" type="text/css">
    <!-- Page level plugin CSS-->
    <link th:href="@{/vendor/datatables/dataTables.bootstrap4.css}" rel="stylesheet">
    <!-- Custom styles for this template-->
    <link th:href="@{/css/sb-admin.css}" rel="stylesheet">
    <!-- Bootstrap core JavaScript-->
    <script th:src="@{/vendor/jquery/jquery.min.js}"></script>
    <script th:src="@{/vendor/bootstrap/js/bootstrap.bundle.min.js}"></script>
    <!-- Core plugin JavaScript-->
    <script th:src="@{/vendor/jquery-easing/jquery.easing.min.js}"></script>
    <!-- Page level plugin JavaScript-->
    <script th:src="@{/vendor/datatables/jquery.dataTables.js}"></script>
    <script th:src="@{/vendor/datatables/dataTables.bootstrap4.js}"></script>
    <!-- Custom scripts for all pages-->
    <script th:src="@{/js/sb-admin.min.js}"></script>
    <!-- Demo scripts for this page-->
    <script th:src="@{/js/demo/datatables-demo.js}"></script>
</head >
<body id="page-top">

<nav class="navbar navbar-expand navbar-dark bg-dark static-top">

    <a class="navbar-brand mr-1" th:href="@{/user/index}">日程云共享管理系统</a>


    <!-- Navbar -->
    <ul class="navbar-nav ml-auto ml-md-12">

        <div th:if="${session.loginUser!=null}">
            <p th:text="${session.loginUser.getUsername()}" style="color:white"> </p>
        </div>
        <li class="nav-item dropdown no-arrow">
            <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="fas fa-user-circle fa-fw"></i>
            </a>
            <div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
                <a class="dropdown-item" href="#">个人设置</a>
                <a class="dropdown-item" th:href="@{/reset-password}">修改密码</a>
                <div class="dropdown-divider"></div>
                <div th:if="${session.loginUser!=null}">
                    <a class="dropdown-item" th:href="@{/logout}" data-toggle="modal" data-target="#logoutModal">注销</a>
                </div>
            </div>
        </li>
    </ul>

</nav>

<div id="wrapper">

    <!-- Sidebar -->
    <ul class="sidebar navbar-nav">
        <li class="nav-item">
            <a class="nav-link" href="#">
                <i class="fas fa-fw fa-tachometer-alt"></i>
                <span>Dashboard</span>
            </a>
        </li>
        <li class="nav-item ">
            <a class="nav-link" th:href="@{/share/community}">
                <i class="fas fa-fw fa-chart-area"></i>
                <span>用户共享社区</span></a>
        </li>
        <li class="nav-item">
            <a class="nav-link" th:href="@{/user/toScheduleframework}">
                <i class="fas fa-fw fa-chart-area"></i>
                <span>日程框架</span></a>
        </li>
        <li class="nav-item ">
            <a class="nav-link" th:href="@{/scheduletable/toScheduletable}">
                <i class="fas fa-fw fa-table"></i>
                <span>日程表</span></a>
        </li>
        <li class="nav-item ">
            <a class="nav-link" th:href="@{/scheduletemplate/toTemplate}">
                <i class="fas fa-fw fa-table"></i>
                <span>日程模版</span></a>
        </li>
        <li class="nav-item " shiro:hasRole="admin">
            <a class="nav-link" th:href="@{/admin/list}">
                <i class="fas fa-fw fa-table"></i>
                <span>用户列表</span></a>
        </li>
    </ul>

    <div id="content-wrapper">

        <div class="container-fluid">

            <!-- Breadcrumbs-->
            <ol class="breadcrumb">
                <li class="breadcrumb-item">
                    <a href="#">Dashboard</a>
                </li>
                <li class="breadcrumb-item active">Search</li>
            </ol>

            <!-- Page Content -->
            <div th:if="${table_result!=null}">
                <h1 class="display-1">Search</h1>
                <p class="lead" style="color: red" th:text="${table_result.get('msg')}">日程表.</p>
                <div style="float: right">
                    <button class="btn btn-primary"  th:onClick="self.location=document.referrer;">返回上一页</button>
                </div>
            </div>

            <div th:if="${framework_result!=null}">
                <h1 class="display-1">Search</h1>
                <p class="lead" style="color: red" th:text="${framework_result.get('msg')}">日程框架.</p>
                <div style="float: right">
                    <button class="btn btn-primary"  th:onClick="self.location=document.referrer;">返回上一页</button>
                </div>
            </div>

            <!-- 日程框架部分-->
            <div class="card mb-3" th:if="${msg_framework!=null}">
                <div class="card-header">
                    <i class="fas fa-table"></i>
                    日程框架
                    <!-- 搜索 -->
                    <form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0" method="get" th:action="@{/share/searchFramework}">
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2" name="value">
                            <div class="input-group-append">
                                <button class="btn btn-primary" type="submit">
                                    <i class="fas fa-search"></i>
                                </button>
                            </div>
                        </div>
                    </form>
                    <div style="float: right">
                        <button class="btn btn-primary"  th:onClick="self.location=document.referrer;">返回上一页</button>
                    </div>
                </div>
                <div class="card-body">
                    <div class="table-responsive" style="height:300px;overflow-x:hidden;overflow-y:scroll;">
                        <table class="table table-bordered table-responsive-xl text-nowrap " >
                            <thead>
                            <tr>
                                <th>id</th>
                                <th>日程框架名</th>
                                <th>组织</th>
                                <th>创建时间</th>
                                <th>开始日期</th>
                                <th>结束日期</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody th:each="framework:${msg_framework.get('page').list}">
                            <tr >
                                <th th:text="${framework.getId()}">id</th>
                                <th th:text="${framework.getName()}">日程框架名</th>
                                <th th:text="${framework.getOrganization()}">组织</th>
                                <th th:text="${#dates.format(framework.getCreateTime(),'yyyy-MM-dd HH:mm')}">创建时间</th>
                                <th th:text="${#dates.format(framework.getStartDate(),'yyyy-MM-dd')}">开始日期</th>
                                <th th:text="${#dates.format(framework.getEndDate(),'yyyy-MM-dd')}">结束日期</th>
                                <th>
                                    <a class="btn btn-primary btn-sm " th:href="@{'/user/view/'+${framework.getId()}}">查看</a>
                                    <a class="btn btn-primary btn-sm " th:href="@{'/share/copy/'+${framework.getId()}}">复制</a>
                                </th>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="card-footer small text-muted" th:each="page:${msg_framework.get('page')}">
                    <ul class="col-md-6">
                        当前第[[${page.list.pageNum}]]页，总[[${page.list.pages}]]页，总[[${page.list.total}]]条记录
                    </ul>
                    <nav aria-label="Page navigation example" style="float:right">
                        <ul class="pagination">
                            <li>
                            <li class="page-item"><a class="page-link" th:href="@{/share/searchFramework}">首页</a></li>
                            </li>
                            <div>
                                <div class="clearfix">
                                    <ul class="pagination m-b-5 pull-right">
                                        <li th:if="${page.hasPreviousPage}" class="page-item">
                                            <a class="page-link" th:href="@{'/share/searchFramework?pageNum='+${page.prePage}}" >
                                                <i class="fa fa-angle-left"></i>上一页
                                            </a>
                                        </li>
                                        <th:block th:each="nav:${page.navigatepageNums}">
                                            <li class="page-item" th:classappend="${nav==page.list.pageNum}?'active':''">
                                                <a class="page-link" th:text="${nav}" th:href="@{'/share/searchFramework?pageNum='+${nav}}"></a>
                                            </li>
                                        </th:block>
                                        <th:block th:if="${page.hasNextPage}">
                                            <li class="page-item">
                                                <a class="page-link" th:href="@{/share/searchFramework?pageNum='+${page.nextPage}}">
                                                    下一页<i class="fa fa-angle-right"></i>
                                                </a>
                                            </li>
                                        </th:block>
                                    </ul>
                                </div>
                            </div>
                            <li>
                            <li class="page-item"><a class="page-link" th:href="@{'/share/searchFramework?pageNum='+${page.list.pages}}">末页</a></li>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>


            <!--日程表部分-->
            <div class="card mb-3" th:if="${msg_table!=null}">
                <div class="card-header">
                    <i class="fas fa-table"></i>
                    日程表
                    <!-- 搜索 -->
                    <form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0" method="get" th:action="@{/share/searchTable}">
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2" name="value">
                            <div class="input-group-append">
                                <button class="btn btn-primary" type="submit">
                                    <i class="fas fa-search"></i>
                                </button>
                            </div>
                        </div>
                    </form>
                    <div style="float: right">
                        <button class="btn btn-primary"  th:onClick="self.location=document.referrer;">返回上一页</button>
                    </div>
                </div>
                <div class="card-body">
                    <div class="table-responsive" style="height:300px;overflow-x:hidden;overflow-y:scroll;">
                        <table class="table table-bordered table-responsive-md text-nowrap">
                            <thead>
                            <tr>
                                <th>id</th>
                                <th>日程表名</th>
                                <th>操作</th>
                                <th>导出</th>
                            </tr>
                            </thead>
                            <tbody th:each="table:${msg_table.get('page').list}">
                                <tr >
                                    <th th:text="${table.getId()}">id</th>
                                    <th th:text="${table.getName()}">日程表名</th>
                                    <th>
                                        <a class="btn btn-primary btn-sm " th:href="@{'/scheduletable/view/'+${table.getId()}}">查看</a>
                                    </th>
                                    <th><a class="btn btn-primary btn-sm " >导出</a>
                                    </th>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="card-footer small text-muted" th:each="page:${msg_table.get('page')}">
                    <ul class="col-md-6">
                        <a>当前第[[${page.list.pageNum}]]页，总[[${page.list.pages}]]页，总[[${page.list.total}]]条记录</a>
                    </ul>
                    <nav aria-label="Page navigation example" style="float:right">
                        <ul class="pagination">
                            <li>
                            <li class="page-item"><a class="page-link" th:href="@{/share/searchTable}">首页</a></li>
                            </li>
                            <div>
                                <div class="clearfix">
                                    <ul class="pagination m-b-5 pull-right">
                                        <li th:if="${page.hasPreviousPage}" class="page-item">
                                            <a class="page-link" th:href="@{'/share/searchTable?pageNum='+${page.prePage}}" >
                                                <i class="fa fa-angle-left"></i>上一页
                                            </a>
                                        </li>
                                        <th:block th:each="nav:${page.navigatepageNums}">
                                            <li class="page-item" th:classappend="${nav==page.list.pageNum}?'active':''">
                                                <a class="page-link" th:text="${nav}" th:href="@{'/share/searchTable?pageNum='+${nav}}"></a>
                                            </li>
                                        </th:block>
                                        <th:block th:if="${page.hasNextPage}">
                                            <li class="page-item">
                                                <a class="page-link" th:href="@{'/share/searchTable?pageNum='+${page.nextPage}}">
                                                    下一页<i class="fa fa-angle-right"></i>
                                                </a>
                                            </li>
                                        </th:block>
                                    </ul>
                                </div>
                            </div>
                            <li>
                            <li class="page-item"><a class="page-link" th:href="@{'/share/searchTable?pageNum='+${page.list.pages}}">末页</a></li>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>

        </div>
        <!-- /.container-fluid -->

        <!-- Sticky Footer -->
        <footer class="sticky-footer">
            <div class="container my-auto">
                <div class="copyright text-center my-auto">
                    <span>Copyright © Your Website 2019</span>
                </div>
            </div>
        </footer>

    </div>
    <!-- /.content-wrapper -->

</div>
<!-- /#wrapper -->

<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
</a>

<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">确定退出登录吗?</h5>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">如果您准备结束当前会话，请在下面选择“退出”。</div>
            <div class="modal-footer">
                <button class="btn btn-secondary" type="button" data-dismiss="modal">取消</button>
                <a class="btn btn-primary" th:href="@{/logout}">退出</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>